package com.zhengtoon.mctoon.conv.job;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.quartz.QuartzJobBean;
import org.springframework.stereotype.Service;

import com.zhengtoon.mctoon.conv.service.sdzc.SendLetterMessageJobService;


/**
 * 信件回复任务定时同步数据
 *
 * @author liuzhenhua
 * @version 2017-06-26
 *          Copyright: Copyright (c) 2017
 *          Company:北京政务通科技有限公司
 */
@Service
public class SyncLetterMessageJob extends QuartzJobBean {
    private static Logger logger = LoggerFactory.getLogger(SyncLetterMessageJob.class);

    @Autowired
    SendLetterMessageJobService sendLetterMessageJobService;

    @Override
    protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
        logger.info("SendLetterMessageJob start ... ");
        try {
          sendLetterMessageJobService.syncLetterMessage() ;
        } catch (Exception e) {
            logger.error("定时任务执行error",e);
        }
        logger.info("SendLetterMessageJob end ... ");

    }

}
